﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using System.Text;
using System.Text.RegularExpressions;
using System.Data;
using System.Web.Configuration;
namespace DreamBox.Admin
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btn_Post_Click(object sender, EventArgs e)
        {
            bool result = true;
            if (UserName.Text.Trim() == "")
            {
                result = false;
            }
            if (UserPass.Text.Trim() == "")
            {
                result = false;
            }
            if (result)
            {
                string UName = WebConfigurationManager.AppSettings["UserName"].ToString();
                string UPass = WebConfigurationManager.AppSettings["UserPass"].ToString();
                if (UserName.Text == UName && UserPass.Text == UPass)
                {
                    Session["UserName"] = UName;
                    Session["UserID"] = 10099;
                    Response.Redirect("default.aspx");
                }
            }
            else
            {
                Response.Write("<script>alert('您的输入验证没通过,不能登录!');</script>");
            }
        }
       
    }
}